package day2;

import java.util.*;

public class Test6 {
    public static int getValue(int[] gifts, int n) {
        // write code here
        int count = 0;
        int[] gift = new int[100000];
        for(int i = 0; i < gifts.length; i++) {
            gift[gifts[i]]++;
        }
        int j = 0;
        for(int i = 0; i < gift.length; i++) {
            if(count < gift[i]) {
                count = gift[i];
                j = i;
            }
        }

        if(count > n/2) {
            return j;
        }else {
            return 0;
        }
    }

    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        int n = scanner.nextInt();
        int n = 45;
        int[] gifts = {975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,975,1336,1327,709,3159,5680,7573,5914,8067,6624,7745,9334,3502,9200,7158,606,1705,5157,5405,1148,6999,9405};
//        for (int i = 0; i < n; i++) {
//            gifts[i] = scanner.nextInt();
//        }

        int ret = getValue(gifts, n);
    }
}
